home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 5 / MacMania 5.toast / / Tools&Utilities / TimGA 1.1 / More Documentation / Help (TimGA) next >
Encoding:
Text File  |  1996-08-17  |  18.9 KB  |  385 lines  |  [ttro/ttxt]

  1. _______________________________________________________________
  2. TimGA — A freeware Mac application
  3. Version 1.1 (August 1996)
  4.  
  5. By Timo Eloranta
  6. Copyright © 1995-96 Brown Eyes Software
  7. All rights reserved.
  8.  
  9. Internet e-mail:  timo.eloranta@ac.com
  10. _______________________________________________________________
  11.  
  12. If you're not familiar with genetic algorithms, I suggest you read
  13. "The Hitch-Hiker's Guide to Evolutionary Computation"
  14. (edited by Joerg Heitkoetter and David Beasley), which is the
  15. FAQ (a list of Frequently Asked Questions) for the comp.ai.genetic 
  16. newsgroup. It is available from
  17.  
  18. http://www.cis.ohio-state.edu/hypertext/faq/usenet/ai-faq/genetic/top.html 
  19.  
  20. _______________________________________________________________
  21.  
  22. Please read the "Read Me (TimGA)" file if you haven't already.
  23. This document — "Help (TimGA)" — contains additional info about the
  24. main window, the menu items and the dialogs of TimGA.
  25.  
  26. Okay, here we go...
  27.  
  28.  
  29. The Main Window
  30. The main window of TimGA has the following fields:
  31.  
  32.   •  Name:
  33.       = The name of the currently open graph.
  34.  
  35.   •  Nodes:
  36.       = The quantity of nodes in the current graph.
  37.  
  38.   •  Edges:
  39.       = The quantity of edges in the current graph.
  40.  
  41.   •  Grid Size:
  42.       = The size of the drawing grid. This can be changed with the "General..."
  43.          command in the "Settings" menu. The default grid size is 40x40.  
  44.          The minimum size is 2x2 (try it!) and the maximum is 70x70.
  45.  
  46.   •  Pop. Size:
  47.       = The size of the population used by the genetic algorithm.
  48.          This too can be changed from the General Settings.
  49.  
  50.   •  Cur. Generation:
  51.       = The number of the current generation. This is 0 until the iteration
  52.          is started.
  53.  
  54.   •  Running Time:
  55.       = The time (minutes:seconds) that the genetic algorithm has used for
  56.          processing the current graph. Note that this does not equal the time
  57.          from the start of the iteration, because some of the time is spent
  58.          outside the genetic algorithm (e.g. the time spent updating the
  59.          best ever drawing, which is visible on the right side of the main
  60.          window...).
  61.  
  62.   •  Least Crossings:
  63.       = The smallest quantity of edge crossings in any of the drawings in
  64.          our current population (yes, the population in TimGA consists of 
  65.          drawings).
  66.  
  67.   •  Avg. Crossings:
  68.       = The average quantity of edge crossings in our current population.
  69.  
  70.   •  Iter. State:
  71.       = The current state of the iteration. The possible states are:
  72.          "No graph" (when no graph is loaded), "Start me up!" (when
  73.          all is ready for the iteration to begin), "Running" (when iterating
  74.          in the foreground), "Running (bg)" (when iterating in the
  75.          background), "Paused" (when the user has halted the iteration
  76.          manually) and "Done" (when the iteration has ended because of one 
  77.          of the termination conditions).
  78.  
  79.   •  Fitness:
  80.       = The fitness of the best drawing found so far. Two values are given.
  81.          The first value is the number of edge crossings in our best drawing.
  82.          The second value is the value given by our fitness function (see the
  83.          "Evaluation..." dialog in the "Settings" menu for details).
  84.  
  85.   •  Generation:
  86.       = The number of the generation when the best drawing was found.
  87.  
  88.   •  No Change (Gen.):
  89.       = Generations since the best drawing was found.
  90.  
  91.   •  No Change (Time):
  92.       = Time spent iterating since the best drawing was found.
  93.  
  94. On the right side of the main window you can always see the best drawing
  95. found so far. If you haven't opened a graph, all you see is the drawing grid.
  96.  
  97.  
  98. The Menus
  99.  
  100.   •  Apple menu: About TimGA...
  101.       = Every decent Mac app needs a cool About box. Is this cool enough?
  102.  
  103.   •  File: Open Graph...
  104.       = With this command you can load one of the graph files. Note that
  105.          only one graph can be open at any single time.
  106.  
  107.   •  File: Rnd New Graph...
  108.       = With this command you can create a random new graph to be drawn.
  109.          The quantity of nodes and edges must be entered. Note that TimGA
  110.          only supports so called simple graphs, which have no self loops
  111.          and no more than one edge between any two nodes. TimGA checks
  112.          the validity of the values you enter, so you don't really need to
  113.          worry...
  114.  
  115.   •  File: Close Graph
  116.       = With this command you can close the current graph. Note that you
  117.          don't actually need to use this command before opening another
  118.          graph because opening another graph will automatically (and without
  119.          any warnings...) close the old graph. You'll mainly need this command
  120.          to get access to the General Settings dialog, which is not available
  121.          if any graph is open.
  122.  
  123.   •  File: Quit
  124.       = Quits the program. No questions asked.
  125.  
  126.   •  Edit: Copy
  127.       = New functionality in TimGA 1.1 !! With this command you can copy
  128.          a drawing to clipboard. You can then paste the picture to any
  129.          graphics or word processing program. This allows you to save and
  130.          print the drawings produced with TimGA.
  131.  
  132.         Before copying the picture you might want to switch to b&w with
  133.         the new Switch to B&W command and/or hide the grid with the
  134.         Hide Grid command (both in Drawing menu). To change the size of
  135.         the drawing use the Increase/Decrease Square Size commands.
  136.         Note also, that the size of the grid (e.g. 10x10 or 40x40) affects
  137.         your possibilities of changing the square size, but you can only change
  138.         the grid size (from the General settings dialog) _before_ opening a
  139.         graph...
  140.  
  141.   •  Edit: Cut, Paste, Clear, Select All...
  142.       = The ordinary stuff. Can only be used in dialogs with edit fields.
  143.  
  144.   •  Iteration: Start/Continue
  145.       = When you have an open graph, you can start the iteration with this
  146.          command. If you have manually paused the iteration you can use
  147.          this same menu item to continue the iteration. If the iteration has
  148.          stopped because of one of the termination conditions, and you'd
  149.          like to still continue the iteration further, you should first remove
  150.          the termination condition that caused the halting. This is done with
  151.          the Termination... dialog.
  152.  
  153.   •  Iteration: Pause
  154.       = This command pauses the iteration temporarily. You can continue
  155.          the iteration with the Continue command if you want. (These
  156.          instructions are getting awfully boring. I hope it's not a sign of a
  157.          boring program...)
  158.  
  159.   •  Iteration: Reinitialize
  160.       = When a new graph is opened, the drawings (note that the program
  161.          processes simultaneously as many drawings as the population has —
  162.          even as you only see the best one on the screen!) are initialized
  163.          by scattering their nodes randomly around the drawing grid. This
  164.          operation can be repeated with this command. You should use this
  165.          command before starting another test run with the same graph.
  166.  
  167.   •  Settings: General...
  168.       = This is the infamous General Settings menu item. And why is it
  169.          not available? Oh well, here's the reason ones more: the General
  170.          Settings are only available when no graph is open! If you want to
  171.          change these settings, you should first close your current
  172.        graph with the Close Graph command in the File menu... 
  173.          Now then, here's what this well protected dialog offers:
  174.  
  175.          •  Speed
  176.              = The minimum time (in ticks) between updating the information
  177.                 on the main screen. The default is 20 which equals 1/3 of a 
  178.                 second (60 ticks = 1 second). So, by default the information
  179.                 on the screen is updated roughly 3 times per second. But here's
  180.                 the catch: the iteration is never interrupted in the middle of
  181.                 a generation and if processing one generation takes longer than
  182.                 the time set here (for example 20 ticks) — and believe me,
  183.                 with slow machines & large graphs it does — then the update
  184.                 interval becomes longer than the time set here.
  185.  
  186.          •  Population  
  187.              = The number of drawings processed simultaneously by the
  188.                 program. If you're familiar with genetic algorithms, you'll
  189.                 know that the default value of 8 is pathetically small. The 
  190.                 main reason for this is speed. If you have no problems with
  191.                 speed (this should be true if you have a PowerMac and are
  192.                 testing the app on smallish graphs...) go ahead and increase
  193.                 the population size. On the other hand, if you have a slowish
  194.                 Mac but would still like to try the bigger graphs, you can try
  195.                 decreasing the population size below the default. 
  196.  
  197.          •  Grid Size 
  198.              = The size of the drawing grid can be adjusted here. This
  199.                 setting affects the appearance of the drawings (for example
  200.                 the size of the nodes) but also the overall performance of the
  201.                 program. Why? Well, the grid should be big enough to give 
  202.                 the nodes plenty of possible locations, but on the other hand
  203.                 many of the operations of the program work faster with a
  204.                 smaller grid... The default size (40x40) is the result of many
  205.                 test runs and should work well with most graphs.
  206.  
  207.   •  Settings: Selection...
  208.       = Selection is one of the stages of the genetic algorithm. If you don't
  209.          know what you're doing, I suggest you stick to the default values.
  210.  
  211.          •  Elitism
  212.              = Elitism means that the best drawing of the population is
  213.                 always selected to the next generation. The performance of
  214.                 the program is VERY likely to suffer, if you turn this off.
  215.  
  216.          •  Linear Normalization: Minimum
  217.          •  Linear Normalization: Step
  218.              = The selection method used by TimGA is called linear
  219.                 normalization. This is a method described by Lawrence
  220.                 Davis in "Handbook of Genetic Algorithms" [1991].
  221.                 The individuals of the population (drawings in this case)
  222.                 are sorted by their fitness. The best individual is then given
  223.                 a certain new score — in TimGA's case this is 100. The
  224.                 second best individual gets a score which is the maximum
  225.                 score (100) minus a so called "step value". The third best
  226.                 gets a score which is the maximum minus two times the
  227.                 step value and so on. But no individual gets a score worse
  228.                 than some fixed minimum score! So, if we'd for example
  229.                 have 8 individuals, a step value of 20 and a minimum value
  230.                 of 15, our "selection array" would be 100, 80, 60, 40, 20,
  231.                 15, 15 and 15. The actual selection is done with these 
  232.                 normalized fitness values. Every individual's probability 
  233.                 of getting selected is proportional to its normalized fitness
  234.                 value. The best individuals are likely to get multiple selections
  235.                 and the worst individuals are most likely to be thrown away.
  236.                 The size of the population always stays the same.
  237.                
  238.                 In TimGA the minimum score is 20 by default. Changing this
  239.                 will affect the so called "selection pressure", but that's too
  240.                 long a story to be told here! The step is by default calculated
  241.                 automagically with the formula:
  242.  
  243.                 Step = (100 - Minimum) / (0.5 * Population Size)
  244.  
  245.                 Note that this formula is by yours truly — not by Mr. Davis.
  246.  
  247.   •  Settings: Recombination...
  248.       = During every generation a part of the population is tampered with
  249.          two "genetic operators": crossover and mutation (Sounds like
  250.          genetics, doesn't it...). Crossover uses two individuals to create
  251.          two new ones which have features from both of their "parents".
  252.          Mutation makes a random change to a single individual.
  253.  
  254.          •  Crossover Probability
  255.              = With this slider you can set the probability of an individual
  256.                 being taken to be a part in a crossover operation. If you are
  257.                 familiar with genetic algorithms, you're probably surprised
  258.                 that the default probability is set to just 5 %. The reason for
  259.                 this is that I wasn't really able to create a crossover operator
  260.                 which would have joined two drawings of the same graph in
  261.                 a useful and efficient way. I tried two different approaches
  262.                 but the test runs showed that neither of them was really worth
  263.                 the processing time that they took. I left them both in TimGA
  264.                 though because a GA is hardly a GA without crossover, but
  265.                 the sad truth is that the performance of TimGA won't suffer
  266.                 much (if at all) even if you set the crossover probability to 0.
  267.  
  268.          •  Mutation Probability
  269.              = With this slider you can set the probability of an individual
  270.                 being mutated with one of the 16 different mutation operators
  271.                 that TimGA has in its "tool chest"... I've completed literally
  272.                 thousands of systematic test runs to optimize this and other
  273.                 parameters. I've set the default for mutation probability to
  274.                 45 %, but the optimal value could be anything between 30 and
  275.                 50 % depending on the graph and the size of the population and... 
  276.  
  277.   •  Settings: Evaluation...
  278.       = The evaluation might be the most important phase in a GA — at least
  279.          it eats most of the processing time! This is the part of the GA which
  280.          should be able to measure the quality of individuals. In TimGA this
  281.          is where we define how "niceness" of the drawings is measured.
  282.  
  283.          •  Edge Crossings
  284.              = By default TimGA always prefers a drawing with minimal edge
  285.                 crossings. The (much) more complex fitness function is only
  286.                 used for sorting drawings with equal quantity of crossings.
  287.                 If you uncheck this checkbox, the fitness function is used for
  288.                 all comparisons. (If you want to totally ignore the edge crossings,
  289.                 you should also set the correct multiplier in the fitness function
  290.                 to zero.)
  291.  
  292.          •  Fitness Function
  293.              = This is the function which measures the quality of the drawings!
  294.                 The program is trying to maximize this function.
  295.  
  296.                 Min. Node Dist. Sum is calculated by adding up the distances
  297.                 from every node to their closest other node. We want this sum
  298.                 to as big as possible, so that the nodes would not get too close
  299.                 to each other.
  300.                 
  301.                 Edge Length Deviation is calculated by measuring the lengths
  302.                 of the edges and by then compairing the lengths to the shortest
  303.                 edge found. Again, a sum is calculated, but this time our goal is
  304.                 to minimize this sum. This part of the function supports the idea
  305.                 of uniform edge lengths — and also effectively shortens the longest
  306.                 edges.
  307.  
  308.                 Min. Node Distance is the shortest distance between any two
  309.                 nodes in the drawing. In the third part of the fitness function, we
  310.                 divide the Edge Length Deviation with this value. This is done to
  311.                 balance the first two parts of the function (we want the edges to
  312.                 get shorter, but not too short...).
  313.  
  314.                 The fourth part of the function rewards for spreading the nodes
  315.                 evenly around the drawing grid. And finally, the fifth part punishes
  316.                 for edge crossings.
  317.  
  318.                 So, there you have it. My fitness function is not too elegant, but it
  319.                 produces fairly good results (IMHO). And by changing the default
  320.                 multipliers & dividers you can do your own experimenting.
  321.  
  322.   •  Settings: Termination...
  323.       = With this dialog you can set one or more termination conditions for
  324.          the iteration. The iteration halts if any of the conditions is met. If
  325.          you set no termination conditions, the iteration will continue until
  326.          you "manually" halt the iteration with the Pause command.
  327.  
  328.          •  Generations
  329.              = You can set a limit to the total number of generations and/or
  330.                 the number of generations without any progress.
  331.  
  332.          •  Time (Seconds)
  333.              = You can set a limit to the iteration time (in seconds) and/or
  334.                 the time without finding a new best drawing.
  335.  
  336.          •  Edge Crossings
  337.              = If you check this checkbox the iteration will stop as soon as 
  338.                 TimGA finds a drawing that has no edge crossings.
  339.  
  340.   •  Drawing: Hide/Show Drawing
  341.       = Hides/shows the best drawing by changing the size of the main window.
  342.          The same effect is achieved by clicking the window's zoom box.
  343.  
  344.   •  Drawing: Hide/Show Grid
  345.       = Hides/shows the drawing grid. If you can't see the grid in the first 
  346.          place (except for the bright green frame), please try the "Brighten 
  347.          Grid" command.
  348.                
  349.   •  Drawing: Hide/Show Edges
  350.       = Hides/shows the edges of the drawing. Personally I find this command
  351.          useful for checking out how evenly the nodes have spread.
  352.  
  353.   •  Drawing: Hide/Show Nodes
  354.       = Hides/shows the nodes of the drawing. Just another feature...
  355.  
  356.   •  Drawing: Brighten/Darken Grid
  357.       = I added this command because I noticed that the default grid colour
  358.          was too dark (invisible actually...) on some monitors — even as its
  359.          just right on my old and trusty monitor. Try it once to see the
  360.          difference!
  361.  
  362.   •  Drawing: Switch to B&W/Color
  363.       = New functionality in TimGA 1.1 !! You can now switch between color
  364.          and b&w modes. Personally I prefer the black and white mode when 
  365.          copying drawings to clipboard to be printed with some other application.
  366.  
  367.   •  Drawing: Increase Square Size
  368.       = New functionality in TimGA 1.1 !! With this command you can increase
  369.          the size of the grid squares, which naturally also increases the size of 
  370.          the nodes. Changing the square size only affects the visual appearance
  371.          of the graph - i.e. it doesn't affect the iteration process in any way.
  372.  
  373.   •  Drawing: Decrease Square Size
  374.       = New functionality in TimGA 1.1 !! With this command you can decrease
  375.          the size of the grid squares, which... (see above)
  376.  
  377.   •  Drawing: Set Square Size...
  378.       = New functionality in TimGA 1.1 !! This command opens a small dialog box
  379.          where you can directly change the size of the grid squares. Illegal values
  380.          are rejected and if you're lucky, you might even get a sensible error
  381.          message... <grin>
  382.  
  383. _______________________________________________________________
  384. Did you really read all of this? Wow!
  385.